package com.memory.demo.Controller;

import com.memory.demo.entity.User;
import org.springframework.web.bind.annotation.*;

import java.util.Arrays;
import java.util.List;

@RestController
public class UserController {

    @PostMapping("/user")
    @CrossOrigin
    public List<User> getUsers(@RequestParam("id") String str){


        System.out.println(str);

        String[] res = str.split("\n");
        for(int i=0,len=res.length;i<len;i++){
            System.out.println(res[i]);
        }


        return Arrays.asList(
                new User("z张三",12),
                new User("lisi",1652),
                new User("wangwu",12)
        );
    }
}
